<?php
//discount percent
$discount = BUtils::GetDiscount($row['value'], $row['price']);
$discount_string = empty($discount) ? '%' : sprintf('%d', $discount) . '%';

//price
$price = Yii::app()->locale->numberFormatter->formatCurrency($row['value'], '');
$value = Yii::app()->locale->numberFormatter->formatCurrency($row['price'], '');

//today
$today = BUtils::T('today_lbl');

//logo_picture
$url_picture = empty($row['url_picture']) ? $row['url_logo'] : $row['url_picture'];

//end_time
$end_time = $row['end_time'];

//special_title
$special_title = $row['type'];

//debug section
$debug = Yii::app()->request->getParam('debug', 0);
if (1 == $debug) {
	echo '<pre>';
	echo 'accessingUrl: ' . Yii::app()->request->getUrl() . "\n";
	print_r($_POST);
	echo '</pre>';
}
?>
</pre>
<div class="form" style="padding:10px;">
	<div class="fieldswrap special relative">
		<div class="discount-box">
			<span class="special-discount"><?php echo $discount_string; ?></span>
		</div>
		<div class="bar">
			<div class="title"><?php echo $special_title; ?></div>
		</div>
		<div class="panel">
			<div class="left" style="margin-right:10px;">
				<img class="picture" width="80" src="<?php echo $url_picture; ?>">
			</div>
			<div>
				<div class="title"><?php echo $row['name']; ?></div>
				<div class="address"><?php echo BUtils::GetAddress($row['address'], $row['postcode'], $row['city']); ?></div>
			</div>
			<div class="clear"></div>
			<div class="text" id="special-content"><?php echo nl2br($row['content']); ?></div>
		</div>
		<div class="offer" id="time-section">
			<div class="icon"><img src="<?php echo Yii::app()->baseUrl; ?>/images/icons/clock_26x26.png" alg=""></div>
			<div class="text">
				<div class="hour-range" id="hour-range"><?php echo $end_time; ?></div>
				<div class="week-days" id="week-days"><?php echo $today; ?></div>
			</div>
			<div class="clear"></div>
		</div>
		<div class="offer" id="price-section">
			<div class="icon"><img src="<?php echo Yii::app()->baseUrl; ?>/images/icons/sale_26x26.png" alg=""></div>
			<div class="text">
				<span class="price"><span class="currency">€</span><span id="price"><?php echo $price; ?></span></span>
				<span class="oldprice space-1" id="value"><?php echo $value; ?></span></div>
			<div class="clear"></div>
		</div>
	</div>
</div>